<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.16"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>ClaraGenomicsAnalysis: common/logging/include/claragenomics/logging/logging.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">ClaraGenomicsAnalysis
   &#160;<span id="projectnumber">0.4.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.16 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_bdd9a5d540de89e9fe90efdfc6973a4f.html">common</a></li><li class="navelem"><a class="el" href="dir_fd0b9fd7ef60505b59d31114acc22533.html">logging</a></li><li class="navelem"><a class="el" href="dir_147746a3e1d59bf3271a44362df8a4c9.html">include</a></li><li class="navelem"><a class="el" href="dir_eb42830a1028b9a58498a5b4f93061b6.html">claragenomics</a></li><li class="navelem"><a class="el" href="dir_2e08afdf66b3501ebb3a28ee9bd47f5a.html">logging</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">logging.hpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="logging_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">* Copyright (c) 2019, NVIDIA CORPORATION.  All rights reserved.</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">*</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">* NVIDIA CORPORATION and its licensors retain all intellectual property</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">* and proprietary rights in and to this software, related documentation</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">* and any modifications thereto.  Any use, reproduction, disclosure or</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">* distribution of this software and related documentation without an express</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">* license agreement from NVIDIA CORPORATION is strictly prohibited.</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">*/</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160; </div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160; </div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor">#include &lt;claragenomics/utils/cudaversions.hpp&gt;</span></div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160; </div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160; </div>
<div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="group__logging.html#ga14a9230fa7689844bc29e62fd7876eb7">   45</a></span>&#160;<span class="preprocessor">#define cga_log_level_debug 0</span></div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="preprocessor">#define cga_log_level_info 1</span></div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="preprocessor">#define cga_log_level_warn 2</span></div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="preprocessor">#define cga_log_level_error 3</span></div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="preprocessor">#define cga_log_level_critical 4</span></div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;<span class="preprocessor">#define cga_log_level_off 5</span></div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160; </div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;<span class="preprocessor">#ifndef CGA_LOG_LEVEL</span></div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;<span class="preprocessor">#ifndef NDEBUG</span></div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;<span class="preprocessor">#define CGA_LOG_LEVEL cga_log_level_debug</span></div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;<span class="preprocessor">#else // NDEBUG</span></div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;<span class="preprocessor">#define CGA_LOG_LEVEL cga_log_level_error</span></div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;<span class="preprocessor">#endif // NDEBUG</span></div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;<span class="preprocessor">#endif // CGA_LOG_LEVEL</span></div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160; </div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;<span class="preprocessor">#if CGA_LOG_LEVEL == cga_log_level_info</span></div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;<span class="preprocessor">#define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_INFO</span></div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;<span class="preprocessor">#elif CGA_LOG_LEVEL == cga_log_level_debug</span></div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;<span class="preprocessor">#define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_DEBUG</span></div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;<span class="preprocessor">#elif CGA_LOG_LEVEL == cga_log_level_warn</span></div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;<span class="preprocessor">#define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_WARN</span></div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;<span class="preprocessor">#elif CGA_LOG_LEVEL == cga_log_level_error</span></div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;<span class="preprocessor">#define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_ERROR</span></div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;<span class="preprocessor">#elif CGA_LOG_LEVEL == cga_log_level_critical</span></div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;<span class="preprocessor">#define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_CRITICAL</span></div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;<span class="preprocessor">#define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_OFF</span></div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160; </div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;<span class="comment">// MUST come after the defines of the logging level!</span></div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;<span class="preprocessor">#ifdef CGA_CUDA_BEFORE_9_2</span></div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;<span class="comment">// Due to a header file incompatibility with nvcc in CUDA 9.0</span></div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;<span class="comment">// logging through the logger class in CGA is disabled for any .cu files.</span></div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;<span class="preprocessor">#pragma message(&quot;Logging disabled for CUDA Toolkit &lt; 9.2&quot;)</span></div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;<span class="preprocessor">#include &lt;spdlog/spdlog.h&gt;</span></div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160; </div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;<span class="keyword">namespace </span>claragenomics</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;{</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;<span class="keyword">namespace </span>logging</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;{</div>
<div class="line"><a name="l00102"></a><span class="lineno"><a class="line" href="group__logging.html#gaa716171cacca628efa44969863d3c43b">  102</a></span>&#160;<span class="keyword">enum class</span> <a class="code" href="group__logging.html#gaa716171cacca628efa44969863d3c43b">LoggingStatus</a></div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;{</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    <a class="code" href="group__logging.html#ggaa716171cacca628efa44969863d3c43ba260ca9dd8a4577fc00b7bd5810298076">success</a> = 0,       </div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    <a class="code" href="group__logging.html#ggaa716171cacca628efa44969863d3c43baac1f4cf357f10c246b3baf4249a5bf54">cannot_open_file</a>,  </div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    <a class="code" href="group__logging.html#ggaa716171cacca628efa44969863d3c43bafe21a9d225faf6903e465fdda696c8ee">cannot_open_stdout</a> </div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;};</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160; </div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;<a class="code" href="group__logging.html#gaa716171cacca628efa44969863d3c43b">LoggingStatus</a> <a class="code" href="group__logging.html#ga1e6ecad63f4d5d90cc01578f653f6e94">Init</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* filename = <span class="keyword">nullptr</span>);</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160; </div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;<a class="code" href="group__logging.html#gaa716171cacca628efa44969863d3c43b">LoggingStatus</a> <a class="code" href="group__logging.html#ga848bc3ae40b237ab46ae622aadab26a5">SetHeader</a>(<span class="keywordtype">bool</span> logTime, <span class="keywordtype">bool</span> logLocation);</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160; </div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;<span class="preprocessor">#ifdef CGA_CUDA_BEFORE_9_2</span></div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;<span class="preprocessor">#define CGA_LOG_DEBUG(...)</span></div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00131"></a><span class="lineno"><a class="line" href="group__logging.html#gaa5ad054c234291111ca2a78bb41946d7">  131</a></span>&#160;<span class="preprocessor">#define CGA_LOG_DEBUG(...) SPDLOG_DEBUG(__VA_ARGS__)</span></div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160; </div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;<span class="preprocessor">#ifdef CGA_CUDA_BEFORE_9_2</span></div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;<span class="preprocessor">#define CGA_LOG_INFO(...)</span></div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00142"></a><span class="lineno"><a class="line" href="group__logging.html#ga6f79986ffd118b37941ef4d3cc4bd1f7">  142</a></span>&#160;<span class="preprocessor">#define CGA_LOG_INFO(...) SPDLOG_INFO(__VA_ARGS__)</span></div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160; </div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;<span class="preprocessor">#ifdef CGA_CUDA_BEFORE_9_2</span></div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;<span class="preprocessor">#define CGA_LOG_WARN(...)</span></div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00153"></a><span class="lineno"><a class="line" href="group__logging.html#gaa97f13dd6ae075b35ca3f01a667d9d83">  153</a></span>&#160;<span class="preprocessor">#define CGA_LOG_WARN(...) SPDLOG_WARN(__VA_ARGS__)</span></div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160; </div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;<span class="preprocessor">#ifdef CGA_CUDA_BEFORE_9_2</span></div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;<span class="preprocessor">#define CGA_LOG_ERROR(...)</span></div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00164"></a><span class="lineno"><a class="line" href="group__logging.html#gacd5f9588e4976ef45d2ddece37b78003">  164</a></span>&#160;<span class="preprocessor">#define CGA_LOG_ERROR(...) SPDLOG_ERROR(__VA_ARGS__)</span></div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160; </div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;<span class="preprocessor">#ifdef CGA_CUDA_BEFORE_9_2</span></div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;<span class="preprocessor">#define CGA_LOG_CRITICAL(...)</span></div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00175"></a><span class="lineno"><a class="line" href="group__logging.html#ga1c62d5c4d4176bc022cee9d01559252c">  175</a></span>&#160;<span class="preprocessor">#define CGA_LOG_CRITICAL(...) SPDLOG_CRITICAL(__VA_ARGS__)</span></div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160; </div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;} <span class="comment">// namespace logging</span></div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;} <span class="comment">// namespace claragenomics</span></div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160; </div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="agroup__logging_html_ggaa716171cacca628efa44969863d3c43ba260ca9dd8a4577fc00b7bd5810298076"><div class="ttname"><a href="group__logging.html#ggaa716171cacca628efa44969863d3c43ba260ca9dd8a4577fc00b7bd5810298076">claragenomics::logging::LoggingStatus::success</a></div><div class="ttdoc">Success.</div></div>
<div class="ttc" id="agroup__logging_html_ga1e6ecad63f4d5d90cc01578f653f6e94"><div class="ttname"><a href="group__logging.html#ga1e6ecad63f4d5d90cc01578f653f6e94">claragenomics::logging::Init</a></div><div class="ttdeci">LoggingStatus Init(const char *filename=nullptr)</div></div>
<div class="ttc" id="agroup__logging_html_ggaa716171cacca628efa44969863d3c43bafe21a9d225faf6903e465fdda696c8ee"><div class="ttname"><a href="group__logging.html#ggaa716171cacca628efa44969863d3c43bafe21a9d225faf6903e465fdda696c8ee">claragenomics::logging::LoggingStatus::cannot_open_stdout</a></div><div class="ttdoc">Stdout could not be opened for logging.</div></div>
<div class="ttc" id="agroup__logging_html_gaa716171cacca628efa44969863d3c43b"><div class="ttname"><a href="group__logging.html#gaa716171cacca628efa44969863d3c43b">claragenomics::logging::LoggingStatus</a></div><div class="ttdeci">LoggingStatus</div><div class="ttdef"><b>Definition:</b> logging.hpp:102</div></div>
<div class="ttc" id="agroup__logging_html_ggaa716171cacca628efa44969863d3c43baac1f4cf357f10c246b3baf4249a5bf54"><div class="ttname"><a href="group__logging.html#ggaa716171cacca628efa44969863d3c43baac1f4cf357f10c246b3baf4249a5bf54">claragenomics::logging::LoggingStatus::cannot_open_file</a></div><div class="ttdoc">Initialization could not open the output file requested.</div></div>
<div class="ttc" id="agroup__logging_html_ga848bc3ae40b237ab46ae622aadab26a5"><div class="ttname"><a href="group__logging.html#ga848bc3ae40b237ab46ae622aadab26a5">claragenomics::logging::SetHeader</a></div><div class="ttdeci">LoggingStatus SetHeader(bool logTime, bool logLocation)</div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.16
</small></address>
</body>
</html>
